<?php

namespace app\common\model\xilujob;

use think\Cache;
use think\Model;

class IndustryCategory extends Model
{


    

    // 表名
    protected $name = 'xilujob_industry_category';
    const CACHE_KEY = "industry_categories";

    // 追加属性
    protected $append = [

    ];




    public static function getAll() {
        $cacheKey = self::CACHE_KEY;
        $all = Cache::get($cacheKey);
        if(!$all) {
            $all = static::field('id,name,weigh')->order('weigh')->select();
            Cache::set($cacheKey, $all, 3600);
        }
        return $all;
    }




}
